package com.tao.product.controller;

import com.tao.product.bean.Product;
import com.tao.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductController {
    @Autowired
    private ProductService productService;
    // 查询商品
    @GetMapping("/product/{productId}")
    public Product getProduct(@PathVariable("productId") Long productId) {
        System.out.println("hello");
        return productService.getProduct(productId);
    }
}
